#include<iostream>
#include<stack>
using namespace std;
stack<char>s;
int main()
{
	int n;
	cin >> n;
	if (n & 1) {
		cout << "No" << endl;
		return 0;
	}
	for (int i = 0; i < n; i++) {
		char c;
		cin >> c;
		if (c == '(')s.push(c);
		else {
			if (s.size() == 0) {
				cout << "No" << endl;
				return 0;
			}
			s.pop();
		}
	}
	if (s.size()) puts("No");
	else puts("Yes");
	return 0;
}
//